package com.easyto.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class PayTestController {

    /**
     * 共享配置文件名称
     */
    @Value("${easyto.text}")
    private String shareName;

    @GetMapping("/test")
    public String getTest() {
        System.out.println(" >>>>>>>>>>> print order test");
        return "200";
    }


    @GetMapping("/share/getValue")
    public String getShareValue() {

        return shareName;
    }


    @GetMapping("/test/req/name")
    public String testName(@RequestHeader("uname") String userName) {
        System.out.println(">>>>>>>>>>>> " + userName);
        return " 2000";
    }

}